using System;
using System.Collections.Generic;
using System.Text;

namespace QuanLyKhachSan
{
    public class PhongDTO
    {
        // Cac thuoc tinh
        private int maPhong;
        private string tenPhong;
        private int maLoaiPhong;
        private int tinhTrang;
        private string ghiChu;
        private int danhDau;       

        // Cac phuong thuc
        public int MaPhong
        {
            get { return maPhong; }
            set { maPhong = value; }
        }
        public string TenPhong
        {
            get { return tenPhong; }
            set { tenPhong = value; }
        }
        public int MaLoaiPhong
        {
            get { return maLoaiPhong; }
            set { maLoaiPhong = value; }
        }
        public int TinhTrang
        {
            get { return tinhTrang; }
            set { tinhTrang = value; }
        }
        public string GhiChu
        {
            get { return ghiChu; }
            set { ghiChu = value; }
        }
        public int DanhDau
        {
            get { return danhDau; }
            set { danhDau = value; }
        }
        public static bool KiemTraTenPhong(string tenPhong)
        {
            if (string.IsNullOrEmpty(tenPhong) == false)//neu no ko trong moi kiem tra tiep
            {
                // Kiem tra giua 2 chu chi co khoang trang
                if (tenPhong.IndexOf("  ") != -1)
                    return false;
                int i;
                // Kiem tra co ki tu ~ hay khong
                for (i = 0; i < tenPhong.Length; i++)
                {
                    if (tenPhong[i] == '~')
                        return false;
                }
                // Kiem tra cac ky tu dau phai ky tu hoa
                string[] arr = tenPhong.Split(' ');

                for (i = 0; i < arr.Length; i++)
                {
                    if (char.IsLower(arr[i][0]) == true)//co loi khi ten  phong =""
                        return false;
                }
                
            }
            return true ;
        }
    }
}
